package com.sakura.flowers.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sakura.flowers.entity.CardFlower;
import com.sakura.flowers.service.CardFlowerService;
import com.sakura.flowers.mapper.CardFlowerMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author Sakura
* @description 针对表【card_flower】的数据库操作Service实现
* @createDate 2024-02-18 21:39:53
*/
@Service
public class CardFlowerServiceImpl extends ServiceImpl<CardFlowerMapper, CardFlower>
    implements CardFlowerService{

    @Resource
    private CardFlowerMapper cardFlowerMapper;

    @Override
    public Page<CardFlower> queryByPage(Integer pageNo, Integer pageSize, String searchKey) {
        Page<CardFlower> flowerPage = this.page(new Page<>(pageNo, pageSize));
        return flowerPage;
    }

    @Override
    public boolean updateAll(Integer selected) {
        return cardFlowerMapper.updateAll(selected);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.cardFlowerMapper.deleteById(id) > 0;
    }
}




